package terrain;

import main.Board;
import main.Unit;

import java.awt.Button;
import java.awt.Graphics;
import java.awt.geom.Area;
import java.awt.geom.Point2D;
import java.util.ArrayList;


public class Terrain {
	
	public static final int FULLY_BLOCKED = 2;
	public static final int PARTIAL_BLOCKED = 1;
	public static final int NOT_BLOCKED = 0;
	
	public Board board;
	public Area obstacle;
	public ArrayList<Unit> contactUnits = new ArrayList<Unit>();
	
	// Is this something that actively blocks, or just ground type?
	public boolean isObstacle = true;
	
	public Terrain() {
	}
	
	/*
	 * Return values:
	 * 		0 / NOT_BLOCKED - sight of target not blocked by obstacle
	 * 		1 / PARTIAL_BLOCKED - sight of target partially blocked by obstacle
	 * 		2 / FULLY_BLOCKED - sight fully blocked
	 */
	public int blocksLOS(Unit looker, Unit target){
		return NOT_BLOCKED;
	}	
	
	public void drawTo(Graphics g){
	}
	
	
	public Point2D contactPoint(int rootX, int rootY, int destX, int destY, int pixelRadius) {
		return null;
	}
	
	public void contactedByUnit(Unit u){
		this.contactUnits.add(u);
	}
	
	public void uncontactedByUnit(Unit u) {
		this.contactUnits.remove(u);
	}

	public Button getInteraction(Unit unit) {
		// TODO Auto-generated method stub
		return null;
	}
	
	// Debug methods
	public void drawLastCheck(Graphics g){
	}

	public Area getObstacle() {
		// TODO Auto-generated method stub
		return this.obstacle;
	}

	public String toMessageString() {
		return "Terrain";
	}
}